//
//  SCMaintUploadCollecCell.m
//  Shuaiche
//
//  Created by liyanan on 2019/8/26.
//  Copyright © 2019 ShuaiChe. All rights reserved.
//

#import "SCMaintUploadCollecCell.h"
#import "UIImageView+WebCache.h"
#import "NSString+Helper.h"
@interface SCMaintUploadCollecCell()

@property (weak, nonatomic) IBOutlet UIButton *deleteBtn;

@end
@implementation SCMaintUploadCollecCell

- (void)setModel:(SCCarAddImageItemModel *)model {
    _model = model;
    _deleteBtn.hidden = model.isAddButton;
    
    if (!model.isAddButton) {
        if (![NSString SC_isBlankString:model.imageUrlPath]) {
            [_imageView sd_setImageWithURL:[NSURL URLWithString:sc_url_img(model.imageUrlPath)] placeholderImage:[UIImage imageNamed:@""]];

        }else if (model.image) {
            _imageView.image = model.image;
        }
    }else {
        _imageView.image = model.image;
    }
}
- (IBAction)deleteImg:(id)sender {
    if ([_delegate respondsToSelector:@selector(deleteImageAtIndexPath:)]) {
        [_delegate deleteImageAtIndexPath:_indexPath];
    }
}
- (void)awakeFromNib {
    [super awakeFromNib];
//    self.backgroundColor = SC_Color_BG;
    // Initialization code
}

@end
